package com.yunliuchain.examination.common.context;


import com.yunliuchain.examination.system.res.UserRes;
import com.yunliuchain.examination.system.res.UserRes;

/**
 * Created by zyang on 2017/6/24 0024.
 */
public final class LoginUserContext {

   private static final ThreadLocal<UserRes> current = new ThreadLocal<UserRes>();

    private LoginUserContext() {
    }

    public static void  setCurrent(UserRes user){
        current.set(user);
    }

    public static UserRes getCurrentUser() {
        return current.get();
    }

    public void close() {
        current.remove();
    }
}
